package com.itheima.innerclass;

public class Demo2 {

    public static void main(String[] args) {

        start(new Swim() {
            public void swim() {
                System.out.println("狗刨");
            }
        });
    }
    public static void start(Swim s) {
        System.out.println("开始");
        s.swim();
        System.out.println("结束");
    }

    public interface Swim{
        public void swim();
    }
}




